package com.cafe.model;

import java.io.File;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.malamute.core.entity.BaseEntity;
import com.malamute.system.entity.FileType;

/**
 * @Title:CafeImage.java
 * @Package com.restaurant.models
 * @Description 餐厅图片对象
 * @author AceGuan gjybst@163.com
 * @date 2012-1-6 上午12:45:27
 * @version v1.0
 */
// @Entity
// @Table(name = "T_CAFE_UPLOAD")
public class Upload extends BaseEntity {

	/**
	 * serialVersionUID:TODO（用一句话描述这个变量表示什么）
	 */

	private static final long serialVersionUID = 1L;

	// struts file 属性
	private File upLoad;
	private String uploadFileName;// 名称
	private String uploadContentType;// 类型
	private String uploadUrl;// url
	@Enumerated(value = EnumType.STRING)
	private FileType fileType = FileType.IMAGE;// 菜单类型

	@ManyToOne(targetEntity = Product.class, fetch = FetchType.EAGER, cascade = CascadeType.PERSIST)
	@JoinColumn(name = "outId", referencedColumnName = "id")
	private Product menu;

	// 自己定义属性
	private String name; // 图片名称
	private String url; // 原图地址
	private String privewUrl; // 预览图地址
	private String description; // 图片描述

	public File getUpLoad() {
		return upLoad;
	}

	public void setUpLoad(File upLoad) {
		this.upLoad = upLoad;
	}

	public String getUploadFileName() {
		return uploadFileName;
	}

	public void setUploadFileName(String uploadFileName) {
		this.uploadFileName = uploadFileName;
	}

	public String getUploadContentType() {
		return uploadContentType;
	}

	public void setUploadContentType(String uploadContentType) {
		this.uploadContentType = uploadContentType;
	}

	public String getUploadUrl() {
		return uploadUrl;
	}

	public void setUploadUrl(String uploadUrl) {
		this.uploadUrl = uploadUrl;
	}

	public Product getMenu() {
		return menu;
	}

	public void setMenu(Product menu) {
		this.menu = menu;
	}

	/**
	 * 获取name
	 * 
	 * @return name
	 */

	public String getName() {
		return name;
	}

	/**
	 * 设置name
	 * 
	 * @param name
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * 获取url
	 * 
	 * @return url
	 */

	public String getUrl() {
		return url;
	}

	/**
	 * 设置url
	 * 
	 * @param url
	 */
	public void setUrl(String url) {
		this.url = url;
	}

	/**
	 * 获取privewUrl
	 * 
	 * @return privewUrl
	 */

	public String getPrivewUrl() {
		return privewUrl;
	}

	/**
	 * 设置privewUrl
	 * 
	 * @param privewUrl
	 */
	public void setPrivewUrl(String privewUrl) {
		this.privewUrl = privewUrl;
	}

	/**
	 * 获取description
	 * 
	 * @return description
	 */

	public String getDescription() {
		return description;
	}

	/**
	 * 设置description
	 * 
	 * @param description
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	public FileType getFileType() {
		return fileType;
	}

	public void setFileType(FileType fileType) {
		this.fileType = fileType;
	}

}
